package connector;

import log.ServerLogger;
import core.Client;

public class MsgProcess extends Thread{
	String msg = null;
	String result = null;

	@Override
	public void run() {

		ServerLogger.INFO("启动事件处理队列");

		while(true){
			//if(Client.isconnected())
			{
				String msgstring = MsgConnectorPool.getInstants().getHccConnector();

				if(msgstring == null){
					try {
						Thread.sleep(10);
						continue;
					} catch (InterruptedException e) {
						e.printStackTrace();
						continue;
					}
				}else
				{
					process(msgstring);
				}
			}

		}
	}

	public void process(String msgstring){
		Client client = Client.getInstance();
		try{
			client.send2pc(msgstring);
		}catch(Exception e){
			e.printStackTrace();
			return;
		}
	}

}
